import { FC } from 'react';

import ViewDialog from './dialog';

import { Button } from 'antd';

import { EyeOutlined } from '@ant-design/icons';
import { useVisible } from '@/biz-components/modals/hooks';
import { SeeTableViewProps } from '@/biz-components/modals/see-table-view/interface';

const SeeTableView: FC<SeeTableViewProps> = ({ dialogProps }) => {
  const [visible, showModal, hiddenModal] = useVisible(false);

  return (
    <>
      <Button onClick={showModal} icon={<EyeOutlined />} type="link" />
      <ViewDialog {...dialogProps} visible={visible} onCancel={hiddenModal} />
    </>
  );
};

export default SeeTableView;
